const express = require('express');
const authority = express.Router();
const search = require('../service/search')
const creates = require('../service/create')
const update = require('../service/update')
const del = require('../service/delete')

authority.get('/search/user',search.SearchUser)
authority.get('/search/group',search.SearchGroup)
authority.get('/friend/all',search.GetFriend)
authority.get('/group/all',search.isMygroup)
authority.post('/friend/add',creates.addFriend)
authority.post('/group/create',creates.addGroup)
authority.get('/group/exist',search.GroupExist)
authority.post('/group/add',creates.addmember)
authority.get('/friend/new',search.searchnewFriend)
authority.put('/friend/new',update.pass)
authority.delete('/friend/new',del.Refuse)
authority.get('/friend/other',search.getuserother)
authority.get('/group/other',search.getgroupother)
authority.get('/user',search.getuserbyid)
authority.put('/user/update',update.edituser)
authority.put('/user/email',update.editemail)
authority.put('/user/pwd',update.editpwd)
authority.get('/group',search.getgroupbyid)
authority.get('/group/user',search.getmember)
authority.put('/group',update.editgroup)
authority.put('/group/user',update.editmem)
authority.delete('/group/user',del.delmember)
authority.delete('/group/all',del.dismissgroup)
authority.post('/msg/user',creates.addmessage)
authority.post('/msg/group',creates.addgmsg)
authority.get('/msg/user',search.getMessage)
authority.get('/msg/group',search.getgmsg)
authority.get('/tip',search.notRead)
authority.post('/read',update.Read)
authority.get('/news',search.getNews)
module.exports = authority